package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_sale_shop")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PosTransactionSaleShop.findAll", query = "SELECT p FROM PosTransactionSaleShop p"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySync", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.sync = :sync"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopId", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopId = :saleShopId"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopNumber", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopNumber = :saleShopNumber"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopSubtotal", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopSubtotal = :saleShopSubtotal"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopDiscountPercent", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopDiscountPercent = :saleShopDiscountPercent"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopDiscountNominal", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopDiscountNominal = :saleShopDiscountNominal"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopTotal", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopTotal = :saleShopTotal"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopDate", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopDate = :saleShopDate"),
    @NamedQuery(name = "PosTransactionSaleShop.findBySaleShopTimestamp", query = "SELECT p FROM PosTransactionSaleShop p WHERE p.saleShopTimestamp = :saleShopTimestamp")})
public class PosTransactionSaleShop implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "sale_shop_id")
    private Integer saleShopId;
    @Basic(optional = false)
    @Column(name = "sale_shop_number")
    private String saleShopNumber;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "sale_shop_subtotal")
    private BigDecimal saleShopSubtotal;
    @Column(name = "sale_shop_discount_percent")
    private BigDecimal saleShopDiscountPercent;
    @Column(name = "sale_shop_discount_nominal")
    private BigDecimal saleShopDiscountNominal;
    @Column(name = "sale_shop_total")
    private BigDecimal saleShopTotal;
    @Column(name = "sale_shop_date")
    @Temporal(TemporalType.DATE)
    private Date saleShopDate;
    @Column(name = "sale_shop_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date saleShopTimestamp;
    @JoinColumn(name = "sale_shop_user_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private MasterUser saleShopUserId;
    @JoinColumn(name = "sale_shop_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit saleShopUnitId;
    @JoinColumn(name = "sale_shop_sales_id", referencedColumnName = "sales_id")
    @ManyToOne(optional = false)
    private PosMasterSales saleShopSalesId;

    public PosTransactionSaleShop() {
    }

    public PosTransactionSaleShop(Integer saleShopId) {
        this.saleShopId = saleShopId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getSaleShopId() {
        return saleShopId;
    }

    public void setSaleShopId(Integer saleShopId) {
        this.saleShopId = saleShopId;
    }

    public PosMasterSales getSaleShopSalesId() {
        return saleShopSalesId;
    }

    public void setSaleShopSalesId(PosMasterSales saleShopSalesId) {
        this.saleShopSalesId = saleShopSalesId;
    }

    public MasterUnit getSaleShopUnitId() {
        return saleShopUnitId;
    }

    public void setSaleShopUnitId(MasterUnit saleShopUnitId) {
        this.saleShopUnitId = saleShopUnitId;
    }

    public MasterUser getSaleShopUserId() {
        return saleShopUserId;
    }

    public void setSaleShopUserId(MasterUser saleShopUserId) {
        this.saleShopUserId = saleShopUserId;
    }

    public String getSaleShopNumber() {
        return saleShopNumber;
    }

    public void setSaleShopNumber(String saleShopNumber) {
        this.saleShopNumber = saleShopNumber;
    }

    public BigDecimal getSaleShopSubtotal() {
        return saleShopSubtotal;
    }

    public void setSaleShopSubtotal(BigDecimal saleShopSubtotal) {
        this.saleShopSubtotal = saleShopSubtotal;
    }

    public BigDecimal getSaleShopDiscountPercent() {
        return saleShopDiscountPercent;
    }

    public void setSaleShopDiscountPercent(BigDecimal saleShopDiscountPercent) {
        this.saleShopDiscountPercent = saleShopDiscountPercent;
    }

    public BigDecimal getSaleShopDiscountNominal() {
        return saleShopDiscountNominal;
    }

    public void setSaleShopDiscountNominal(BigDecimal saleShopDiscountNominal) {
        this.saleShopDiscountNominal = saleShopDiscountNominal;
    }

    public BigDecimal getSaleShopTotal() {
        return saleShopTotal;
    }

    public void setSaleShopTotal(BigDecimal saleShopTotal) {
        this.saleShopTotal = saleShopTotal;
    }

    public Date getSaleShopDate() {
        return saleShopDate;
    }

    public void setSaleShopDate(Date saleShopDate) {
        this.saleShopDate = saleShopDate;
    }

    public Date getSaleShopTimestamp() {
        return saleShopTimestamp;
    }

    public void setSaleShopTimestamp(Date saleShopTimestamp) {
        this.saleShopTimestamp = saleShopTimestamp;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (saleShopId != null ? saleShopId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionSaleShop)) {
            return false;
        }
        PosTransactionSaleShop other = (PosTransactionSaleShop) object;
        if ((this.saleShopId == null && other.saleShopId != null) || (this.saleShopId != null && !this.saleShopId.equals(other.saleShopId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionSaleShop[ saleShopId=" + saleShopId + " ]";
    }
}
